﻿using MongoDB.Bson;
using Ongoal.Quotation.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ongoal.Quotation.Service.Interface
{
    /// <summary>
    /// 文档服务相关接口
    /// </summary>
    public interface IDocService : IServiceBase
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        dynamic GetOne(string tableName, string id);

        /// <summary>
        /// 
        /// </summary>
        dynamic Insert(string tableName, BsonDocument obj);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="obj"></param>
        /// <returns></returns>
        dynamic Update(string tableName, BsonDocument obj);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="idList"></param>
        /// <returns></returns>
        dynamic Delete(string tableName, List<string> idList);
        /// <summary>
        /// 
        /// </summary>
        dynamic GetAll(string tableName);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="size"></param>
        /// <param name="index"></param>
        /// <param name="searchJson"></param>
        /// <returns></returns>
        object Search(string tableName, int size, int index, string searchJson);

        /// <summary>
        /// 根据查询条件当前单条数据
        /// </summary>
        /// <param name="TableName">数据名</param>
        /// <param name="searchJson">查询条件</param>
        /// <returns></returns>
        Task<dynamic> GetOneData(string TableName, string searchJson);

        /// <summary>
        /// 根据查询条件当前全部数据
        /// </summary>
        /// <param name="TableName">数据名</param>
        /// <param name="searchJson">查询条件</param>
        /// <returns></returns>
        Task<dynamic> GetDataList(string TableName, string searchJson);

    }
}
